# 状态模式
class State:
    def write_program(self):
        pass

class Work:
    def __init__(self):
        self.hour = 9
        self.current = For


class NoonState(State):
    def write_program(self, w):
        print("noon working")
        if(w.hour<12):
            print("fun.")
        else:
            print("need to rest.")


class ForenoonState(State):
    def write_program(self, w):
        if(w.hour<12):
            print("morning working")
            print("energetic")
        else:
            print("need to rest.")

